rem Finds out if PCTODAY.EXE is found on your path.
iff "%@search[pctoday.exe]" =="" then
beep
text
This batch needs PCTODAY.EXE (c) by Ethan Winer
(downloadable from SIMTEL20: <msdos.pcmag>VOL10N21.ZIP)
endtext
quit
endiff
iff %@index[%1,h] ge 0 .or. %@index[%1,?] ge 0 then
goto help
elseiff %@index[%1,i] ge 0 then
goto help_i
endiff
:compu_name
if "%compuname"=="" gosub compuname
setlocal
:set_temp
if "%temp"=="" gosub setramd
: (temporary drive will be defined %_lastdisk if it is not remote
: or cd-rom drive.)
if not direxist %temp (set temp=^gosub setramd)
iff "%@substr[%temp,0,-1]" == "\" then
set temp=%temp%
else
set temp=%temp\
endiff
iff %@index[%1,x] ge 0 then
goto extract_f
endiff
gosub check_args
iff %@index[%1,/s] ge 0 .or. %@index[%1,-s] ge 0 then
set zz=%@substr[%1,2]
goto _date2
elseiff %@index[%1,s] eq 0 then
set zz=%@substr[%1,1]
goto _date2
else
goto _date1
endiff
:set_defaults
:_date1
set xx=%@date[%_date]
: This is today'y date in full numbers since 1-1-1980
set zz=%@makedate[%@eval[%xx-%1]]
: This is the actual date desired for the archive file.
: If no number of days indicated by user, you get today's
: date again.
if %@index[%zz,0] eq 0 set zz=%@substr[%zz,1]
: If a zero (0) is contained on the first position (01, etc.),
: it will be removed.
:_date2
set rsp=%temp%updates.rsp
set zipfn=%temp%updates.zip
set tmpf=%@unique[%temp]
if exist %zipfn del /q %zipfn
rem (This is just a precaution; this file is moved anyway, if batch
rem terminates in a normal way.)
:modifiables
rem ==> Modify any of the following variables to your preference.
set exclude=-x*.tmp -x*.00? -x*.bak -xpctoday.* -x*.zip -xkermit.*
rem (filepatterns excluded from updating)
set dr=%archive_drive
iff %@index[%dr,:] eq 1 then
set dr=%@substr[%dr,1,-1]
endiff
rem ('archive_drive' was determined by the 'checking drives' subroutines.
rem This is the drive for the final ZIP archive; the temporary file will
rem be created on your 'temp' drive, if it exists, else on deafult
rem drive.)
set pkz=pkzip -P -ex
rem (archiving with pathnames; erase '-P' if no pathnames desired)
set colordir=dirs:bright white;zip:black on white;
set edt=ped.exe
rem ^^^^^^^ (replace ped.exe by your preferred editor)
:re-use?
cls
if exist %rsp goto ask
goto accumulate
:ask
echo.
gosub legenda
screen 2 0
inkey /K"YNVESQ" Use extant list file? (created %@filedate[%rsp], at %@filetime[%rsp])? [time now: %_time]n (List File is: %@upper[%rsp])nnType Y/N, V(iew), S(creen), E(dit), or Q(uit) %%rep
iff %rep == Q then cls^screen 2 0^set ech=echo Stopped by user^ goto end
elseiff %rep == Y then goto backup
elseiff %rep == V then *list %rsp^cls^goto ask
elseiff %rep == E then %edt %rsp^goto backup
elseiff %rep == S then echo. >%tmpf^cls^set num=0^goto edit
elseiff %rep == N goto accumulate
endiff
:accumulate
cls
iff %_monitor == mono then
screen 4 5 [ making a list of all new files created since %zz ]